import type { page, pageParams } from '@/types/global'
import type { ItemArray, categoryItem, guessLike, hotItem } from '@/types/home'
import { http } from '@/utils/http'
/**
 * 首页获取广告轮播图
 * @param distributionSite 广告区域展示位置,参数1 为首页（默认值），参数2 为商品分类页
 */
export const getHomePic = (distributionSite = 1) => {
  return http<ItemArray>({
    method: 'GET',
    url: '/home/banner',
    data: {
      distributionSite,
    },
  })
}

/**
 * 分类数据
 */
export const getCategorize = () => {
  return http<categoryItem>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}

/* 获取hot数据 */
export const getHot = () => {
  return http<hotItem>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}

/* 获取猜你喜欢 */
export const getGuess = (data: pageParams) => {
  return http<page<guessLike>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}
